// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import {
  DatasetTaskType,
  IDataset,
  IModelExplanationData
} from "@responsible-ai/core-ui";

export const blbooksgenre: IDataset = {
  categorical_features: [],
  class_names: ["Fiction", "Nonfiction"],
  feature_names: [
    "positive_words",
    "negative_words",
    "negation_words",
    "negated_entities",
    "named_persons",
    "sentence_length"
  ],
  features: [
    [0, 0, 0, 0, 2, 125],
    [3, 0, 0, 0, 2, 51],
    [0, 0, 0, 0, 0, 95],
    [4, 0, 0, 0, 1, 72],
    [3, 0, 0, 0, 1, 54]
  ],
  predicted_y: [1, 1, 1, 0, 1],
  probability_y: [
    [0.008636139333248138, 0.9913638830184937],
    [0.006692204624414444, 0.9933078289031982],
    [0.008428489789366722, 0.9915715456008911],
    [0.9905497431755066, 0.00945029966533184],
    [0.010247726924717426, 0.9897522926330566]
  ],
  target_column: "label",
  task_type: DatasetTaskType.TextClassification,
  true_y: [1, 1, 1, 0, 1]
};

export const blbooksgenreModelExplanationData: Omit<
  IModelExplanationData,
  "predictedY" | "probabilityY"
> = {
  precomputedExplanations: {
    globalFeatureImportance: {
      featureNames: [
        "",
        "Finland",
        "s",
        "Historia",
        "fr\\\\u00e5n",
        "den",
        "\\\\u00e4l",
        "ds",
        "ta",
        "tide",
        "n",
        "int",
        "ill",
        "v\\\\u00e5r",
        "a",
        "da",
        "gar",
        ".",
        "\\\\u00d6f",
        "vers",
        "\\\\u00e4tt",
        "ning",
        "Fins",
        "kan",
        "af",
        "R",
        "Her",
        "tz",
        "berg",
        "Auto",
        "rise",
        "rad",
        "up",
        "pl",
        "aga",
        "\\\\u00c7a",
        "ira",
        "!",
        "or",
        "Dan",
        "ton",
        "in",
        "the",
        "French",
        "Revolution",
        "A",
        "study",
        "Sv",
        "eri",
        "ges",
        "re",
        "Gust",
        "f\\\\u00f6r",
        "ste",
        "met",
        "s\\\\u00e4ns",
        "ki",
        "ld",
        "t",
        "see",
        "nde",
        "p\\\\u00e5",
        "val",
        "och",
        "ek",
        "ono",
        "mi",
        "The",
        "Captain",
        "of",
        "'",
        "Mary",
        "Rose",
        "tale",
        "to",
        "-",
        "morrow",
        "Illustrated",
        ",",
        "etc",
        "Annals",
        "Au",
        "cht",
        "era",
        "rder",
        "and",
        "Memorials",
        "St",
        "rath",
        "ear"
      ],
      intercept: 0.49999997951090336,
      scores: [
        0.00014806688943283812, 0.1132531670995781, 0.0011172704722007944,
        0.1533228916616483, 0.033307972598629054, 0.017454969680531777,
        0.0020012995195833757, 0.011106959075227173, 0.011325902156790512,
        0.040478283783563204, 0.046567529169098835, 0.04378829429010188,
        0.0001480674432564734, 0.0672646847463006, 0.0003713147805279328,
        0.007760141897273974, 0.006765676350591497, 0.008670460133759817,
        0.024142969383683523, 0.029823597737413367, 0.041733699124112414,
        0.03531320481658137, 0.012677100152359344, 0.04401144130679313,
        0.03779532607586589, 0.014939091794076376, 0.0029771017853459907,
        0.013534239447890837, 0.013763267734303196, 0.05720430722081423,
        0.0017125079649811998, 0.02285891049919505, 0.0013929627956008616,
        0.05634180005911049, 0.01311929696277958, 0.004782823059940711,
        0.00969617924420163, 0.0021036280086264014, 0.07708782542613335,
        0.027533378146472387, 0.10711358473054133, 0.0975860555190593,
        0.03182883208064595, 0.20357103620335693, 0.3376829906410421,
        0.0018258992155703404, 0.00692283765723308, 0.06382420788334761,
        0.02852609440499994, 0.05623349382706995, 0.021442388599098194,
        0.00848386924189981, 0.01828669032208078, 0.018359044634659462,
        0.018140819234152637, 0.005200262225116603, 0.014188473069225438,
        0.07312525769521017, 0.011449851799018992, 0.029223957055364735,
        0.05064810630574357, 0.012155158110545017, 0.057503672311819784,
        0.025821162907717125, 0.040630648614993936, 0.024764598234711836,
        0.02268637175826977, 0.049102448516350705, 0.03789708642580081,
        0.04793049877116573, 0.03465866204278427, 0.0197131387409172,
        0.04520395155268488, 0.17783237612457015, 0.03984005834111789,
        0.025753874540290173, 0.04373774816728352, 0.008134358358802274,
        0.0015882042062003165, 0.0026844444510061294, 0.10444398751133122,
        0.010017379012424499, 0.012986631772946566, 0.02771486624260433,
        0.01384403309202753, 0.15017642575548962, 0.4324281474982854,
        0.11392892905860208, 0.06467670304118656, 0.10195652014226653
      ]
    },
    textFeatureImportance: [
      {
        localExplanations: [
          [-0.0005755636246047086, 0.0005755675439205434],
          [-0.11325316688615, 0.11325316731300619],
          [0.0011172727811046773, -0.0011172681632969114],
          [-0.09000208672821625, 0.09000208689313796],
          [-0.02925147164367243, 0.029251476232376363],
          [-0.016503993583480932, 0.016503973346617486],
          [-0.0020012988307927214, 0.00200130020837403],
          [-0.011106957920775231, 0.011106960229679115],
          [-0.011325901206065383, 0.01132590310751564],
          [-0.04047828466152876, 0.04047828290559766],
          [-0.024248574236278526, 0.024248573295254674],
          [-0.04378829444047167, 0.04378829413973209],
          [0.00014806746750966552, -0.00014806741900328128],
          [-0.06726468457943863, 0.06726468491316255],
          [0.00037131541305118136, -0.0003713141480046842],
          [-0.007760141381166047, 0.007760142413381901],
          [-0.006765674670330352, 0.006765678030852642],
          [-0.007405249039745993, 0.007405260432925489],
          [-0.019638479076093063, 0.019638489466160536],
          [-0.00447086276835762, 0.004470867570489645],
          [-0.024142968180240133, 0.02414297058712691],
          [-0.029823597232461908, 0.029823598242364822],
          [-0.04173369682199943, 0.0417337014262254],
          [-0.030088193479847786, 0.030088199015396336],
          [-0.011317391324943553, 0.011317391709114114],
          [-0.012677100620931015, 0.012677099683787673],
          [-0.04401144235744141, 0.044011440256144854],
          [-0.060025873378617686, 0.06002586982212961],
          [-0.01493909188429825, 0.0149390917038545],
          [0.0008244744210969656, -0.0008244794327765704],
          [-0.002977101341292093, 0.0029771022293998885],
          [-0.013534237839683721, 0.013534241056097953],
          [-0.013763267290249298, 0.013763268178357093],
          [0.0011240842524619604, -0.0011240839852358808],
          [-0.05720430420869377, 0.057204310232934694],
          [-0.0017125019260623708, 0.0017125140039000288],
          [-0.02285891058663253, 0.022858910411757565],
          [-0.0013929619056347042, 0.001392963685567019],
          [-0.05634179800499112, 0.056341802113229866],
          [-0.013119297877250913, 0.01311929604830825],
          [-0.0006703257085619399, 0.0006703309421488023]
        ],
        text: [
          "",
          "Finland",
          "s ",
          "Historia ",
          "fr\\\\u00e5n ",
          "den ",
          "\\\\u00e4l",
          "ds",
          "ta ",
          "tide",
          "n ",
          "int",
          "ill ",
          "v\\\\u00e5r",
          "a ",
          "da",
          "gar ",
          ".",
          ".",
          ". ",
          "\\\\u00d6f",
          "vers",
          "\\\\u00e4tt",
          "ning ",
          "fr\\\\u00e5n ",
          "Fins",
          "kan ",
          "af ",
          "R",
          ". ",
          "Her",
          "tz",
          "berg",
          ". ",
          "Auto",
          "rise",
          "rad ",
          "up",
          "pl",
          "aga",
          ""
        ]
      },
      {
        localExplanations: [
          [-0.00014047062722966075, 0.00014046579599380493],
          [0.004782827396411449, -0.004782818723469973],
          [-0.009696196182630956, 0.009696162305772305],
          [0.002103631617501378, -0.002103624399751425],
          [-0.07708782370900735, 0.07708782714325935],
          [-0.027533373038750142, 0.027533383254194632],
          [-0.10711358636035584, 0.10711358310072683],
          [-0.12919402778788935, 0.12919402966508642],
          [-0.026113287065527402, 0.026113292027730495],
          [-0.2035710362397367, 0.20357103616697714],
          [-0.33768298574432265, 0.3376829955377616],
          [-0.050095938553567976, 0.05009594094008207],
          [0.0003391065013905366, -0.0003391103819012642],
          [-0.0069228253948191805, 0.006922849919646978],
          [1.2212277700503668e-5, -1.220405101776123e-5]
        ],
        text: [
          "",
          "\\\\u00c7a ",
          "ira",
          "! ",
          "or ",
          "Dan",
          "ton ",
          "in ",
          "the ",
          "French ",
          "Revolution",
          ". ",
          "A ",
          "study",
          ""
        ]
      },
      {
        localExplanations: [
          [-0.0003755814832402393, 0.00037558458279818296],
          [-0.06382420649849034, 0.06382420926820487],
          [-0.02852609651260233, 0.028526092297397554],
          [-0.056233497418967694, 0.05623349023517221],
          [-0.06597807754587848, 0.06597808707738295],
          [-0.021442381155793555, 0.021442396042402834],
          [-0.2166436969564529, 0.21664369606878608],
          [-0.05935505610250402, 0.05935504857916385],
          [0.008483872409366693, -0.008483866074432928],
          [-0.002103982599995409, 0.0021039863737920923],
          [-0.018405954489329208, 0.018405957302699488],
          [-0.02209391799988225, 0.022093920813252527],
          [-0.018359040201175958, 0.01835904906814297],
          [0.018140824045985937, -0.018140814422319334],
          [0.00520026552840136, -0.005200258921831846],
          [-0.01418847349123098, 0.014188472647219896],
          [-0.07312525846646167, 0.07312525692395866],
          [-0.0007966816483531147, 0.0007966889534145594],
          [-0.051256120951923854, 0.05125612332873667],
          [-0.02922395295657528, 0.029223961154154193],
          [-0.05064810584493292, 0.050648106766554214],
          [0.01215516313095577, -0.012155153090134263],
          [-0.014479460792952321, 0.014479461682236029],
          [-0.0575036663956578, 0.05750367822798176],
          [-0.02210301127504661, 0.022103025319261685],
          [-0.04053820915740087, 0.0405382176136805],
          [0.025821159792960516, -0.025821166022473738],
          [-0.040630652137204175, 0.040630645092783704],
          [-0.024764600709184174, 0.024764595760239497],
          [-0.02268637184622801, 0.022686371670311525],
          [-0.00023908613818801112, 0.00023908281905783544]
        ],
        text: [
          "",
          "Sv",
          "eri",
          "ges ",
          "in",
          "re ",
          "Historia ",
          "fr\\\\u00e5n ",
          "Gust",
          "af ",
          "den ",
          "f\\\\u00f6r",
          "ste ",
          "met ",
          "s\\\\u00e4ns",
          "ki",
          "ld",
          "t ",
          "af",
          "see",
          "nde ",
          "p\\\\u00e5 ",
          "f\\\\u00f6r",
          "val",
          "t",
          "ning ",
          "och ",
          "ek",
          "ono",
          "mi",
          ""
        ]
      },
      {
        localExplanations: [
          [0.00028246454894542694, -0.00028246085275895894],
          [0.0662063080817461, -0.06620630194083788],
          [-0.03789708763360977, 0.037897085217991844],
          [-0.050314128398895264, 0.05031412772950716],
          [-0.03754437537863851, 0.03754437385068741],
          [-0.02584242830052972, 0.02584243562014308],
          [0.01971313813701272, -0.019713139344821683],
          [0.0452039529569447, -0.045203950148425064],
          [0.0027489759027957915, -0.0027489865547977387],
          [-0.04347488936036825, 0.04347489489009604],
          [-0.003990904428064823, 0.00399090931750834],
          [0.17783238179981709, -0.1778323704493232],
          [-0.0442474652081728, 0.04424747370649129],
          [-0.039840059665342174, 0.0398400570168936],
          [-0.02575387836744388, 0.025753870713136468],
          [0.04373774925867716, -0.04373774707588988],
          [-0.0032545700669288635, 0.003254570037825033],
          [-0.002353191375732422, 0.0023531714687123895],
          [-0.004183843731880188, 0.004183852695859969],
          [-0.008134353905916214, 0.008134362811688334],
          [-0.0015881992876529694, 0.0015882091247476637],
          [0.0026844553649425507, -0.002684433537069708],
          [0.00022568926215171814, -0.00022569048451259732]
        ],
        text: [
          "",
          "The ",
          "Captain ",
          "of ",
          "the ",
          "'",
          "Mary ",
          "Rose",
          ".",
          "' ",
          "A ",
          "tale ",
          "of ",
          "to",
          "-",
          "morrow ",
          ".",
          ".",
          ". ",
          "Illustrated",
          ", ",
          "etc",
          ""
        ]
      },
      {
        localExplanations: [
          [0, 0],
          [0.03199859557207674, -0.031998588470742106],
          [-0.10444399277912453, 0.1044439822435379],
          [-0.038635460019577295, 0.038635459961369634],
          [-0.010017378721386194, 0.010017379303462803],
          [-0.012986625311896205, 0.012986638233996928],
          [-0.027714859403204173, 0.027714873082004488],
          [-0.013844024681020528, 0.013844041503034532],
          [-0.15017642441671342, 0.15017642709426582],
          [-0.4324281539884396, 0.4324281410081312],
          [-0.05852493137354031, 0.05852494377177209],
          [-0.1139289287966676, 0.11392892932053655],
          [-0.06467671348946169, 0.06467669259291142],
          [0.1019565230817534, -0.10195651720277965],
          [-0.06888648978201672, 0.06888647936284542],
          [0, 0]
        ],
        text: [
          "",
          "The ",
          "Annals ",
          "of ",
          "Au",
          "cht",
          "era",
          "rder ",
          "and ",
          "Memorials ",
          "of ",
          "St",
          "rath",
          "ear",
          "n",
          ""
        ]
      }
    ]
  }
};
